$NG.AllReady(function (page, { useAction, useValuesChange, useDataIndexChange, useUpdateRow, useUpdateRows }) {
    console.log("page is ready");
    console.log("page", page);
    console.log($NG.getPageUI());
    console.log($NG.getPageState());
  
    const toolbar = $NG.getCmpApi("toolbar");
  
    toolbar.getItem("billQuote").setHidden();
  
    // 监听 PhidPayway
    useValuesChange(({ args }) => {
      console.log(`监听结算方式`);
      console.log(args);
  
      let isXianHui = false;
  
      if (args[0].PhidPayway.value == 8570000000000001) {
        console.log(`xian hui`);
        isXianHui = true;
      }
      const fields = ["user_pj_pay", "user_pjqx"];
  
      $NG.updateUI((updater) => {
        console.log(updater);
        updater.fieldSetForm.PaymentBill.user_pay_qd.setProps({
          required: isXianHui, //必输
        });
        fields.forEach((field) => {
          updater.fieldSetForm.PaymentBill[field].setProps({
            required: !isXianHui, //必输
          });
        });
      });
    }, "fc3_payment_bill.PhidPayway");

  
    /* 明细 */
  
    useDataIndexChange(({ args, instance }) => {
      console.log(`监听 fc3_payment_bill_d PhidSupplyEnt`, args);
      const record = args[0];
      console.log(record.PhidSupplyEnt);
  
      $NG.execServer("getYhInfo", { gys: record.PhidSupplyEnt }, function (res) {
        console.log("GetbankInfo", res);
        try {
          const datas = JSON.parse(res.data)[0].extendObjects;
          console.log(datas);
          record.RecAccNo = datas.user_yhzh;
          record.RecAccName = datas.user_yhzhmc;
          record.PhidBank = datas.phid;
          record.PhidBank_EXName = datas.bankname;
          instance.updateRow(args[0]);
        } catch (error) {
          console.error("解析银行信息失败：", error);
        }
      });
    }, "fc3_payment_bill_d.PhidSupplyEnt");
  });
  